<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="__STATIC__/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__STATIC__/css/font.css">
    <link rel="stylesheet" href="__STATIC__/css/xadmin.css">
    <script src="__STATIC__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__STATIC__/js/xadmin.js"></script>
</head>
<style>
    .layui-table-body {
        overflow: -webkit-paged-x;
    }
</style>

<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">会员管理</a>
        <a>
          <cite>会员列表</cite>
        </a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">&#xe666;</i></a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-body">
                    <form class="layui-form layui-col-space5" style="text-align: center">
                        <div class="layui-inline layui-show-xs-block" style="width: 300px;">
                            <input type="text" name="where"  placeholder="昵称 | ID | 手机号 | 真实姓名" autocomplete="off" class="layui-input">
                        </div>
                        <div class="layui-inline layui-show-xs-block">
                            <button class="layui-btn"  lay-submit="" lay-filter="sreach">筛选</button>
                        </div>
                    </form>
                </div>
                <table class="layui-hide" id="test" lay-filter="test"></table>

                <script type="text/html" id="toolbarDemo">
                    <div class="layui-btn-container">

                    </div>
                </script>
                <script type="text/html" id="barDemo">
                </script>
            </div>
        </div>
    </div>
</div>
<script>
    layui.use(['table','form'], function(){
        var table = layui.table
            ,form = layui.form;
        table.render({
            elem: '#test'
            ,url:'{:url("Member/memberData")}'
            ,toolbar: '#toolbarDemo'
            ,title: '权限表'
            ,cols: [[
                {type: 'checkbox', fixed: 'left'}
                ,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true}
                ,{field:'nickname', title:'昵称'}
                ,{field:'headimgurl', title:'头像',templet:function (d) {
                    return '<img src="'+d.headimgurl+'" alt="..." height="35px" />';
                }}
                ,{field:'sex', title:'性别',templet:function (d) {
                    if(d.sex==1){
                        return '男';
                    }else if(d.sex==2){
                        return '女';
                    }else{
                        return '未知';
                    }

                }}
                ,{field:'userphone', title:'手机号'}
                ,{field:'create_time', title:'创建时间', width:160}
            ]]
            ,page: true
            ,done:function () {

            }
        });

        form.on('submit(sreach)',function (data) {
            table.reload('test',{
                where:data.field
            });
            return false;
        });


    });
</script>
</body>

</html>